﻿CloudDisk.MockData = [
    {"file_id":"11","file_name":"测试文件夹",category_id: '0', isFolder:1,"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"1","owner_uid":"1","size":"","create_date":"1364894003","update_date":"1364894003","mime_type":"","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
    {"file_id":"1","file_name":"file01",category_id: '0',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"1","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"application/vnd.ms-excel","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
	{"file_id":"2","file_name":"file02",category_id: '0',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"11","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"application/vnd.ms-excel","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
    {"file_id":"3","file_name":"file03",category_id: '0',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"1","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"application/vnd.ms-excel","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
	{"file_id":"4","file_name":"file04",category_id: '0',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"1","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"audio/mpeg","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
    {"file_id":"5","file_name":"file05",category_id: '0',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"11","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"audio/mpeg","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
	{"file_id":"6","file_name":"file06",category_id: '1',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"1","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"application/pdf","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
    {"file_id":"7","file_name":"file07",category_id: '1',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"1","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"application/pdf","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
	{"file_id":"8","file_name":"file08",category_id: '1',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"1","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"text/plain ","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
    {"file_id":"9","file_name":"file09",category_id: '1',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"1","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"audio/mpeg","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
	{"file_id":"10","file_name":"file10",category_id: '1',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"1","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"text/plain","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"},
	{"file_id":"12","file_name":"file12",category_id: '2',"path":"D:\\www\\htdocs\\yii-rest\\readme","folder_id":"1","owner_uid":"1","size":"1024","create_date":"1364894003","update_date":"1364894003","mime_type":"application/pdf","hash":"DODESTCOLUMNE","create_uid":"1","create_uname":"admin"}
];

CloudDisk.MockData.get = function(cid, fid){
    var d = [];
	$.each(this, function(n, v){
	    if(cid){
			if(v.category_id == cid){
				if(fid){
					if(v.folder_id== fid){
						d.push(v);
					}
				} else {
					d.push(v);
				}
			}
		} else {
            if(fid){
			    if(v.folder_id== fid){
				    d.push(v);
				}
			} else {
			    d.push(v);
			}		
		}
	});	

	return d;

};